import React from 'react'
import store from "@/store"
import { increment, decrement,incrementWait } from "@/store/actions/countAction"

export default function Count() {
  // console.log(store);
  // console.log(store.getState());
  return (
    <div>
      <h1>Count:{store.getState().count}</h1>
      <h2>电影列表的长度是：{store.getState().movie.movieList.length}</h2>
      <button onClick={() => {
        store.dispatch(increment(10))
      }}>累加count</button>
      <button onClick={() => {
        store.dispatch(decrement(5))
      }}>累减count</button>

      <button onClick={() => {
        store.dispatch(incrementWait(5))
      }}>等2s累加count</button>
    </div>
  )
}
